using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VMSSTAMM
    {
        public DataRow Convert2MSSTAMM(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryMSSTAMM(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["MSMANDANT"] = " ".PadRight(2 ); 
         dwReturn["MSMAT"] = " ".PadRight(14 ); 
         dwReturn["MSVAR"] = " ".PadRight(3 ); 
         dwReturn["MSAENZL"] = " ".PadRight(0 ); 
         dwReturn["MSAENB"] = " ".PadRight(8 ); 
         dwReturn["MSAEND"] = " ".PadRight(0 ); 
         dwReturn["MSNEUB"] = " ".PadRight(8 ); 
         dwReturn["MSNEUD"] = " ".PadRight(0 ); 
         dwReturn["MSSTAKZ"] = " ".PadRight(1 ); 
         dwReturn["MSSTVAR"] = " ".PadRight(1 ); 
         dwReturn["MSBEZ"] = " ".PadRight(50 ); 
         dwReturn["MSKBEZ"] = " ".PadRight(25 ); 
         dwReturn["MSSACHGEB"] = " ".PadRight(3 ); 
         dwReturn["MSPRODKL"] = " ".PadRight(7 ); 
         dwReturn["MSFERTKZ"] = " ".PadRight(1 ); 
         dwReturn["MSDINNR"] = " ".PadRight(17 ); 
         dwReturn["MSLAGME"] = " ".PadRight(3 ); 
         dwReturn["MSEINKME"] = " ".PadRight(3 ); 
         dwReturn["MSEINKFAK"] = " ".PadRight(12 ); 
         dwReturn["MSVERBME1"] = " ".PadRight(3 ); 
         dwReturn["MSVERBFAK1"] = " ".PadRight(12 ); 
         dwReturn["MSVERBME2"] = " ".PadRight(3 ); 
         dwReturn["MSVERBFAK2"] = " ".PadRight(12 ); 
         dwReturn["MSSDBLDAT"] = " ".PadRight(0 ); 
         dwReturn["MSBEHVOR"] = " ".PadRight(4 ); 
         dwReturn["MSRAUMBED"] = " ".PadRight(4 ); 
         dwReturn["MSCHARBEST"] = " ".PadRight(1 ); 
         dwReturn["MSBEM"] = " ".PadRight(40 ); 
         dwReturn["MSLAE"] = " ".PadRight(9 ); 
         dwReturn["MSHOE"] = " ".PadRight(9 ); 
         dwReturn["MSBRT"] = " ".PadRight(9 ); 
         dwReturn["MSVOL"] = " ".PadRight(9 ); 
         dwReturn["MSBRUT"] = " ".PadRight(12 ); 
         dwReturn["MSNET"] = " ".PadRight(12 ); 
         dwReturn["MSDICK"] = " ".PadRight(9 ); 
         dwReturn["MSDURCH"] = " ".PadRight(9 ); 
         dwReturn["MSFERTTEXT"] = " ".PadRight(10 ); 
         dwReturn["MSKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["MSVRPR"] = " ".PadRight(9 ); 
         dwReturn["MSVRPRN"] = " ".PadRight(9 ); 
         dwReturn["MSVRPRNDAT"] = " ".PadRight(0 ); 
         dwReturn["MSINPR"] = " ".PadRight(9 ); 
         dwReturn["MSINPRDAT"] = " ".PadRight(0 ); 
         dwReturn["MSKTOKL3"] = " ".PadRight(6 ); 
         dwReturn["MSKTOKL4"] = " ".PadRight(6 ); 
         dwReturn["MSSUBSYS1"] = " ".PadRight(2 ); 
         dwReturn["MSSUBSYS2"] = " ".PadRight(2 ); 
         dwReturn["MSMATART1"] = " ".PadRight(10 ); 
         dwReturn["MSMATART2"] = " ".PadRight(10 ); 
         dwReturn["MSMATART"] = " ".PadRight(4 ); 
         dwReturn["MSKONZ"] = " ".PadRight(0 ); 
         dwReturn["MSPHMIN"] = " ".PadRight(0 ); 
         dwReturn["MSPHMAX"] = " ".PadRight(0 ); 
         dwReturn["MSSPEZGEW"] = " ".PadRight(0 ); 
         dwReturn["MSLOESLICH"] = " ".PadRight(0 ); 
         dwReturn["MSLOESTEMP"] = " ".PadRight(0 ); 
         dwReturn["MSLOESZT"] = " ".PadRight(0 ); 
         dwReturn["MSSACHB"] = " ".PadRight(8 ); 
         dwReturn["MSTRSUBS"] = " ".PadRight(0 ); 
         dwReturn["MSMUSTER"] = " ".PadRight(1 ); 
         dwReturn["MSGEBAUSZ"] = " ".PadRight(1 ); 
         dwReturn["MSHALTBTG"] = " ".PadRight(0 ); 
         dwReturn["MSKONSI"] = " ".PadRight(1 ); 
         dwReturn["MSABW"] = " ".PadRight(0 ); 
         dwReturn["MSMATCHCO"] = " ".PadRight(14 ); 
         dwReturn["MSBESTVOR"] = " ".PadRight(1 ); 
         dwReturn["MSDECKEB"] = " ".PadRight(2 ); 
         dwReturn["MSWARNLO"] = " ".PadRight(1 ); 
         dwReturn["MSWARNTG"] = " ".PadRight(1 ); 
         dwReturn["MSPROF"] = " ".PadRight(1 ); 
         dwReturn["MSAGZUST"] = " ".PadRight(1 ); 
         dwReturn["MSFBCODE"] = " ".PadRight(10 ); 
         dwReturn["MSFAMILIE"] = " ".PadRight(5 ); 
         dwReturn["MSSCHABNR"] = " ".PadRight(13 ); 
         dwReturn["MSTAX"] = " ".PadRight(3 ); 
         dwReturn["MSFBEZ"] = " ".PadRight(50 ); 
         dwReturn["MSPRODH"] = " ".PadRight(18 ); 
         dwReturn["MSMATKL"] = " ".PadRight(9 ); 
         dwReturn["MSPMGRP"] = " ".PadRight(4 ); 
         dwReturn["MSBKLAS"] = " ".PadRight(4 ); 
         dwReturn["MSMGKMM"] = " ".PadRight(8 ); 
         dwReturn["MSBWPLAN"] = " ".PadRight(1 ); 
         dwReturn["MSEKGRP"] = " ".PadRight(3 ); 
         dwReturn["MSVABME"] = " ".PadRight(1 ); 
         dwReturn["MSEKWSL"] = " ".PadRight(4 ); 
         dwReturn["MSPROGRP"] = " ".PadRight(3 ); 
         dwReturn["MSARTGRP"] = " ".PadRight(3 ); 
         dwReturn["MSSDSA"] = " ".PadRight(4 ); 
         dwReturn["MSSDSCHL"] = " ".PadRight(21 ); 
         dwReturn["MSFILLER"] = " ".PadRight(54 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapMSSTAMM(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveMSSTAMM(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryMSSTAMM(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapMSSTAMM(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertMSSTAMM(dwLocal, ITXDBVERSION);
            }
            UpdateMSSTAMM(dwLocal);
        }
        public void InsertMSSTAMM(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO MSSTAMM(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryMSSTAMM(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM MSSTAMM WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM MSSTAMM  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "MSSTAMM";
            Return = Result;
            return Return;
        }
        public void DeleteMSSTAMM(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM MSSTAMM   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateMSSTAMM(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE MSSTAMM SET "
                    +"MSMANDANT= :MSMANDANT,"
                    +"MSMAT= :MSMAT,"
                    +"MSVAR= :MSVAR,"
                    +"MSAENZL= :MSAENZL,"
                    +"MSAENB= :MSAENB,"
                    +"MSAEND= :MSAEND,"
                    +"MSNEUB= :MSNEUB,"
                    +"MSNEUD= :MSNEUD,"
                    +"MSSTAKZ= :MSSTAKZ,"
                    +"MSSTVAR= :MSSTVAR,"
                    +"MSBEZ= :MSBEZ,"
                    +"MSKBEZ= :MSKBEZ,"
                    +"MSSACHGEB= :MSSACHGEB,"
                    +"MSPRODKL= :MSPRODKL,"
                    +"MSFERTKZ= :MSFERTKZ,"
                    +"MSDINNR= :MSDINNR,"
                    +"MSLAGME= :MSLAGME,"
                    +"MSEINKME= :MSEINKME,"
                    +"MSEINKFAK= :MSEINKFAK,"
                    +"MSVERBME1= :MSVERBME1,"
                    +"MSVERBFAK1= :MSVERBFAK1,"
                    +"MSVERBME2= :MSVERBME2,"
                    +"MSVERBFAK2= :MSVERBFAK2,"
                    +"MSSDBLDAT= :MSSDBLDAT,"
                    +"MSBEHVOR= :MSBEHVOR,"
                    +"MSRAUMBED= :MSRAUMBED,"
                    +"MSCHARBEST= :MSCHARBEST,"
                    +"MSBEM= :MSBEM,"
                    +"MSLAE= :MSLAE,"
                    +"MSHOE= :MSHOE,"
                    +"MSBRT= :MSBRT,"
                    +"MSVOL= :MSVOL,"
                    +"MSBRUT= :MSBRUT,"
                    +"MSNET= :MSNET,"
                    +"MSDICK= :MSDICK,"
                    +"MSDURCH= :MSDURCH,"
                    +"MSFERTTEXT= :MSFERTTEXT,"
                    +"MSKUNDNR= :MSKUNDNR,"
                    +"MSVRPR= :MSVRPR,"
                    +"MSVRPRN= :MSVRPRN,"
                    +"MSVRPRNDAT= :MSVRPRNDAT,"
                    +"MSINPR= :MSINPR,"
                    +"MSINPRDAT= :MSINPRDAT,"
                    +"MSKTOKL3= :MSKTOKL3,"
                    +"MSKTOKL4= :MSKTOKL4,"
                    +"MSSUBSYS1= :MSSUBSYS1,"
                    +"MSSUBSYS2= :MSSUBSYS2,"
                    +"MSMATART1= :MSMATART1,"
                    +"MSMATART2= :MSMATART2,"
                    +"MSMATART= :MSMATART,"
                    +"MSKONZ= :MSKONZ,"
                    +"MSPHMIN= :MSPHMIN,"
                    +"MSPHMAX= :MSPHMAX,"
                    +"MSSPEZGEW= :MSSPEZGEW,"
                    +"MSLOESLICH= :MSLOESLICH,"
                    +"MSLOESTEMP= :MSLOESTEMP,"
                    +"MSLOESZT= :MSLOESZT,"
                    +"MSSACHB= :MSSACHB,"
                    +"MSTRSUBS= :MSTRSUBS,"
                    +"MSMUSTER= :MSMUSTER,"
                    +"MSGEBAUSZ= :MSGEBAUSZ,"
                    +"MSHALTBTG= :MSHALTBTG,"
                    +"MSKONSI= :MSKONSI,"
                    +"MSABW= :MSABW,"
                    +"MSMATCHCO= :MSMATCHCO,"
                    +"MSBESTVOR= :MSBESTVOR,"
                    +"MSDECKEB= :MSDECKEB,"
                    +"MSWARNLO= :MSWARNLO,"
                    +"MSWARNTG= :MSWARNTG,"
                    +"MSPROF= :MSPROF,"
                    +"MSAGZUST= :MSAGZUST,"
                    +"MSFBCODE= :MSFBCODE,"
                    +"MSFAMILIE= :MSFAMILIE,"
                    +"MSSCHABNR= :MSSCHABNR,"
                    +"MSTAX= :MSTAX,"
                    +"MSFBEZ= :MSFBEZ,"
                    +"MSPRODH= :MSPRODH,"
                    +"MSMATKL= :MSMATKL,"
                    +"MSPMGRP= :MSPMGRP,"
                    +"MSBKLAS= :MSBKLAS,"
                    +"MSMGKMM= :MSMGKMM,"
                    +"MSBWPLAN= :MSBWPLAN,"
                    +"MSEKGRP= :MSEKGRP,"
                    +"MSVABME= :MSVABME,"
                    +"MSEKWSL= :MSEKWSL,"
                    +"MSPROGRP= :MSPROGRP,"
                    +"MSARTGRP= :MSARTGRP,"
                    +"MSSDSA= :MSSDSA,"
                    +"MSSDSCHL= :MSSDSCHL,"
                    +"MSFILLER= :MSFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("MSMANDANT", OracleType.NVarChar).Value = dwData["MSMANDANT"].ToString(); 
          or1.Parameters.Add("MSMAT", OracleType.NVarChar).Value = dwData["MSMAT"].ToString(); 
          or1.Parameters.Add("MSVAR", OracleType.NVarChar).Value = dwData["MSVAR"].ToString(); 
          or1.Parameters.Add("MSAENZL", OracleType.NVarChar).Value = dwData["MSAENZL"].ToString(); 
          or1.Parameters.Add("MSAENB", OracleType.NVarChar).Value = dwData["MSAENB"].ToString(); 
          or1.Parameters.Add("MSAEND", OracleType.NVarChar).Value = dwData["MSAEND"].ToString(); 
          or1.Parameters.Add("MSNEUB", OracleType.NVarChar).Value = dwData["MSNEUB"].ToString(); 
          or1.Parameters.Add("MSNEUD", OracleType.NVarChar).Value = dwData["MSNEUD"].ToString(); 
          or1.Parameters.Add("MSSTAKZ", OracleType.NVarChar).Value = dwData["MSSTAKZ"].ToString(); 
          or1.Parameters.Add("MSSTVAR", OracleType.NVarChar).Value = dwData["MSSTVAR"].ToString(); 
          or1.Parameters.Add("MSBEZ", OracleType.NVarChar).Value = dwData["MSBEZ"].ToString(); 
          or1.Parameters.Add("MSKBEZ", OracleType.NVarChar).Value = dwData["MSKBEZ"].ToString(); 
          or1.Parameters.Add("MSSACHGEB", OracleType.NVarChar).Value = dwData["MSSACHGEB"].ToString(); 
          or1.Parameters.Add("MSPRODKL", OracleType.NVarChar).Value = dwData["MSPRODKL"].ToString(); 
          or1.Parameters.Add("MSFERTKZ", OracleType.NVarChar).Value = dwData["MSFERTKZ"].ToString(); 
          or1.Parameters.Add("MSDINNR", OracleType.NVarChar).Value = dwData["MSDINNR"].ToString(); 
          or1.Parameters.Add("MSLAGME", OracleType.NVarChar).Value = dwData["MSLAGME"].ToString(); 
          or1.Parameters.Add("MSEINKME", OracleType.NVarChar).Value = dwData["MSEINKME"].ToString(); 
          or1.Parameters.Add("MSEINKFAK", OracleType.NVarChar).Value = dwData["MSEINKFAK"].ToString(); 
          or1.Parameters.Add("MSVERBME1", OracleType.NVarChar).Value = dwData["MSVERBME1"].ToString(); 
          or1.Parameters.Add("MSVERBFAK1", OracleType.NVarChar).Value = dwData["MSVERBFAK1"].ToString(); 
          or1.Parameters.Add("MSVERBME2", OracleType.NVarChar).Value = dwData["MSVERBME2"].ToString(); 
          or1.Parameters.Add("MSVERBFAK2", OracleType.NVarChar).Value = dwData["MSVERBFAK2"].ToString(); 
          or1.Parameters.Add("MSSDBLDAT", OracleType.NVarChar).Value = dwData["MSSDBLDAT"].ToString(); 
          or1.Parameters.Add("MSBEHVOR", OracleType.NVarChar).Value = dwData["MSBEHVOR"].ToString(); 
          or1.Parameters.Add("MSRAUMBED", OracleType.NVarChar).Value = dwData["MSRAUMBED"].ToString(); 
          or1.Parameters.Add("MSCHARBEST", OracleType.NVarChar).Value = dwData["MSCHARBEST"].ToString(); 
          or1.Parameters.Add("MSBEM", OracleType.NVarChar).Value = dwData["MSBEM"].ToString(); 
          or1.Parameters.Add("MSLAE", OracleType.NVarChar).Value = dwData["MSLAE"].ToString(); 
          or1.Parameters.Add("MSHOE", OracleType.NVarChar).Value = dwData["MSHOE"].ToString(); 
          or1.Parameters.Add("MSBRT", OracleType.NVarChar).Value = dwData["MSBRT"].ToString(); 
          or1.Parameters.Add("MSVOL", OracleType.NVarChar).Value = dwData["MSVOL"].ToString(); 
          or1.Parameters.Add("MSBRUT", OracleType.NVarChar).Value = dwData["MSBRUT"].ToString(); 
          or1.Parameters.Add("MSNET", OracleType.NVarChar).Value = dwData["MSNET"].ToString(); 
          or1.Parameters.Add("MSDICK", OracleType.NVarChar).Value = dwData["MSDICK"].ToString(); 
          or1.Parameters.Add("MSDURCH", OracleType.NVarChar).Value = dwData["MSDURCH"].ToString(); 
          or1.Parameters.Add("MSFERTTEXT", OracleType.NVarChar).Value = dwData["MSFERTTEXT"].ToString(); 
          or1.Parameters.Add("MSKUNDNR", OracleType.NVarChar).Value = dwData["MSKUNDNR"].ToString(); 
          or1.Parameters.Add("MSVRPR", OracleType.NVarChar).Value = dwData["MSVRPR"].ToString(); 
          or1.Parameters.Add("MSVRPRN", OracleType.NVarChar).Value = dwData["MSVRPRN"].ToString(); 
          or1.Parameters.Add("MSVRPRNDAT", OracleType.NVarChar).Value = dwData["MSVRPRNDAT"].ToString(); 
          or1.Parameters.Add("MSINPR", OracleType.NVarChar).Value = dwData["MSINPR"].ToString(); 
          or1.Parameters.Add("MSINPRDAT", OracleType.NVarChar).Value = dwData["MSINPRDAT"].ToString(); 
          or1.Parameters.Add("MSKTOKL3", OracleType.NVarChar).Value = dwData["MSKTOKL3"].ToString(); 
          or1.Parameters.Add("MSKTOKL4", OracleType.NVarChar).Value = dwData["MSKTOKL4"].ToString(); 
          or1.Parameters.Add("MSSUBSYS1", OracleType.NVarChar).Value = dwData["MSSUBSYS1"].ToString(); 
          or1.Parameters.Add("MSSUBSYS2", OracleType.NVarChar).Value = dwData["MSSUBSYS2"].ToString(); 
          or1.Parameters.Add("MSMATART1", OracleType.NVarChar).Value = dwData["MSMATART1"].ToString(); 
          or1.Parameters.Add("MSMATART2", OracleType.NVarChar).Value = dwData["MSMATART2"].ToString(); 
          or1.Parameters.Add("MSMATART", OracleType.NVarChar).Value = dwData["MSMATART"].ToString(); 
          or1.Parameters.Add("MSKONZ", OracleType.NVarChar).Value = dwData["MSKONZ"].ToString(); 
          or1.Parameters.Add("MSPHMIN", OracleType.NVarChar).Value = dwData["MSPHMIN"].ToString(); 
          or1.Parameters.Add("MSPHMAX", OracleType.NVarChar).Value = dwData["MSPHMAX"].ToString(); 
          or1.Parameters.Add("MSSPEZGEW", OracleType.NVarChar).Value = dwData["MSSPEZGEW"].ToString(); 
          or1.Parameters.Add("MSLOESLICH", OracleType.NVarChar).Value = dwData["MSLOESLICH"].ToString(); 
          or1.Parameters.Add("MSLOESTEMP", OracleType.NVarChar).Value = dwData["MSLOESTEMP"].ToString(); 
          or1.Parameters.Add("MSLOESZT", OracleType.NVarChar).Value = dwData["MSLOESZT"].ToString(); 
          or1.Parameters.Add("MSSACHB", OracleType.NVarChar).Value = dwData["MSSACHB"].ToString(); 
          or1.Parameters.Add("MSTRSUBS", OracleType.NVarChar).Value = dwData["MSTRSUBS"].ToString(); 
          or1.Parameters.Add("MSMUSTER", OracleType.NVarChar).Value = dwData["MSMUSTER"].ToString(); 
          or1.Parameters.Add("MSGEBAUSZ", OracleType.NVarChar).Value = dwData["MSGEBAUSZ"].ToString(); 
          or1.Parameters.Add("MSHALTBTG", OracleType.NVarChar).Value = dwData["MSHALTBTG"].ToString(); 
          or1.Parameters.Add("MSKONSI", OracleType.NVarChar).Value = dwData["MSKONSI"].ToString(); 
          or1.Parameters.Add("MSABW", OracleType.NVarChar).Value = dwData["MSABW"].ToString(); 
          or1.Parameters.Add("MSMATCHCO", OracleType.NVarChar).Value = dwData["MSMATCHCO"].ToString(); 
          or1.Parameters.Add("MSBESTVOR", OracleType.NVarChar).Value = dwData["MSBESTVOR"].ToString(); 
          or1.Parameters.Add("MSDECKEB", OracleType.NVarChar).Value = dwData["MSDECKEB"].ToString(); 
          or1.Parameters.Add("MSWARNLO", OracleType.NVarChar).Value = dwData["MSWARNLO"].ToString(); 
          or1.Parameters.Add("MSWARNTG", OracleType.NVarChar).Value = dwData["MSWARNTG"].ToString(); 
          or1.Parameters.Add("MSPROF", OracleType.NVarChar).Value = dwData["MSPROF"].ToString(); 
          or1.Parameters.Add("MSAGZUST", OracleType.NVarChar).Value = dwData["MSAGZUST"].ToString(); 
          or1.Parameters.Add("MSFBCODE", OracleType.NVarChar).Value = dwData["MSFBCODE"].ToString(); 
          or1.Parameters.Add("MSFAMILIE", OracleType.NVarChar).Value = dwData["MSFAMILIE"].ToString(); 
          or1.Parameters.Add("MSSCHABNR", OracleType.NVarChar).Value = dwData["MSSCHABNR"].ToString(); 
          or1.Parameters.Add("MSTAX", OracleType.NVarChar).Value = dwData["MSTAX"].ToString(); 
          or1.Parameters.Add("MSFBEZ", OracleType.NVarChar).Value = dwData["MSFBEZ"].ToString(); 
          or1.Parameters.Add("MSPRODH", OracleType.NVarChar).Value = dwData["MSPRODH"].ToString(); 
          or1.Parameters.Add("MSMATKL", OracleType.NVarChar).Value = dwData["MSMATKL"].ToString(); 
          or1.Parameters.Add("MSPMGRP", OracleType.NVarChar).Value = dwData["MSPMGRP"].ToString(); 
          or1.Parameters.Add("MSBKLAS", OracleType.NVarChar).Value = dwData["MSBKLAS"].ToString(); 
          or1.Parameters.Add("MSMGKMM", OracleType.NVarChar).Value = dwData["MSMGKMM"].ToString(); 
          or1.Parameters.Add("MSBWPLAN", OracleType.NVarChar).Value = dwData["MSBWPLAN"].ToString(); 
          or1.Parameters.Add("MSEKGRP", OracleType.NVarChar).Value = dwData["MSEKGRP"].ToString(); 
          or1.Parameters.Add("MSVABME", OracleType.NVarChar).Value = dwData["MSVABME"].ToString(); 
          or1.Parameters.Add("MSEKWSL", OracleType.NVarChar).Value = dwData["MSEKWSL"].ToString(); 
          or1.Parameters.Add("MSPROGRP", OracleType.NVarChar).Value = dwData["MSPROGRP"].ToString(); 
          or1.Parameters.Add("MSARTGRP", OracleType.NVarChar).Value = dwData["MSARTGRP"].ToString(); 
          or1.Parameters.Add("MSSDSA", OracleType.NVarChar).Value = dwData["MSSDSA"].ToString(); 
          or1.Parameters.Add("MSSDSCHL", OracleType.NVarChar).Value = dwData["MSSDSCHL"].ToString(); 
          or1.Parameters.Add("MSFILLER", OracleType.NVarChar).Value = dwData["MSFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
